{* Smarty *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$adminPageTitle}</title>
<meta name="keywords" content="Green Black, Free CSS Templates, Web Design" />
<meta name="description" content="Green Black - Download free CSS templates from templatemo.com" />
<link href="{$siteUrl}css/templatemo_style.css" rel="stylesheet" type="text/css" />
<script src="{$siteUrl}js/clearFields.js" type="text/javascript"></script>
<script src="{$siteUrl}js/analiza.js" type="text/javascript"></script>

	<link href="{$siteUrl}js/jquery-ui/css/trontastic/jquery-ui-1.10.3.custom.css" rel="stylesheet">
	<script src="{$siteUrl}js/jquery-ui/js/jquery-1.9.1.js"></script>
	<script src="{$siteUrl}js/jquery-ui/js/jquery-ui-1.10.3.custom.js"></script>
	<script>
		var url = '{$siteUrl}';
	</script>

{literal}
<script>
<!--
	$(function() {
		$( "#dateWritten" ).datepicker({
			dateFormat: 'yy-mm-dd'
		}).val();
	});
// -->
</script>
{/literal}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="{$siteUrl}js/jquery.form.js"></script>
{literal}
<script type="text/javascript">
$(document).ready(function() 
{ 
	$('#photoimg').live('change', function(){ 
		$("#preview").html('');
		$("#preview").html('<img src="'+url+'images/loader.gif" alt="Uploading...."/>');
		$("#imageform").ajaxForm(
			{
				target: '#preview'
	}).submit();
	});
}); 
</script>
{/literal}


</head>
<body>

<script type="text/javascript" src="{$siteUrl}js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="{$siteUrl}js/tiny_mce_init.js"></script>

<p><h1>{$lang.band.editArticleInfo}</h1></p>
<hr>





<form id="imageform" method="post" enctype="multipart/form-data" action='{$siteUrl}ajaximage.php'>
	{$lang.band.changeImage} <input type="file" name="photoimg" id="photoimg" />
</form>






{if $action == 'updateNews'}
<form method="post" id="mainform"  name="mainform" action="{$siteUrl}band/updateNews">
	<input type="hidden" name="idNewsa" value="{$news.id}"/>
	<input type="hidden" name="possition" id="possition" value="{$news.possition}"/>
	<table>
		<tr>
			<td>{$lang.band.image}:</td>
			<td>
				<div id='preview'>
					<img src="{$siteUrl}images/{$news.image}" /> 
				</div>
			</td>
		</tr>
		<tr>
			<td>{$lang.band.articleTitle}:</td>
			<td><input type="text" name="label" id="label" value="{$news.label}" cols="100" /></td>
		</tr>
		<tr>
			<td> {$lang.band.descr}</td>
			<td><textarea name="text" id="text" style="width:100%">{$news.text}</textarea></td>
		</tr>
		<tr>
			<td></td>
			<td> <input type="submit" name="sendForm" id="sendForm" value="{$lang.common.send}"/></td>
		</tr>
	</table>
</form>
{/if}

{if $action == 'updateSong'}
<form method="post" action="{$siteUrl}band/updateSong">
	<input type="hidden" name="songId" value="{$song.id}"/>
	<table>
		<tr>
			<td>{$lang.band.image}:</td>
			<td>
				<div id='preview'>
					<img src="{$siteUrl}images/{$song.image}" /> 
				</div>
			</td>
		</tr>
		<tr>
			<td>{$lang.band.articleTitle}:</td>
			<td><input type="text" name="label" id="label" value="{$song.label}" cols="100" /></td>
		</tr>
		<tr>
			<td>{$lang.songs.lyrAuthor}:</td>
			<td>
				<select name="authorLyrics" id="authorLyrics">
					<option value="-2">{$lang.common.select}</option>
					<option value="-1" {if ($song.authorLyrZespolId == -1)} selected = "selected"{/if}>{$lang.band.auhorOther}</option>
					{foreach from=$authors item=auth}
						<option value="{$auth.id}" {if ($song.authorLyrZespolId == $auth.id)}selected = "selected"{/if}>{$auth.nick}</option>
					{/foreach}
				</select>
				<input type="text" name="authorLyricsOther" id="authorLyricsOther" value="{$song.authorLyr}" cols="100" />
			</td>
		</tr>
		<tr>
			<td>{$lang.songs.muzAuthor}:</td>
			<td>
				<select name="authorMusic" id="authorMusic">
					<option value="-2">{$lang.common.select}</option>
					<option value="-1" {if ($song.authorMusicZespolId == -1)} selected = "selected"{/if}>{$lang.band.auhorOther}</option>
					{foreach from=$authors item=auth}
						<option value="{$auth.id}" {if ($song.authorMusicZespolId == $auth.id)}selected = "selected"{/if}>{$auth.nick}</option>
					{/foreach}
				</select>
				<input type="text" name="authorMusicOther" id="authorMusicOther" value="{$song.authorMusic}" cols="100" />
			</td>
		</tr>		
		<tr>
			<td>{$lang.band.songShortDesc}:</td>
			<td><input type="text" name="text" id="text" value="{$song.text}" cols="300" /></td>
		</tr>
		<tr>
			<td>{$lang.songs.songCreationDate}:</td>
			<td><input type="text" name="dateWritten" id="dateWritten" value="{$song.dateWritten}" cols="300" /></td>
		</tr>		
		<tr>
			<td>{$lang.songs.songIlustrationTxt}:</td>
			<td><input type="text" name="songIlustrationTxt" id="songIlustrationTxt" value="{$song.imageAlt}" cols="300" /></td>
		</tr>			
		<tr>
			<td> {$lang.band.lyrics}</td>
			<td><textarea name="lyrics" id="lyrics" style="width:100%">{$song.lyrics}</textarea></td>
		</tr>
		<tr>
			<td></td>
			<td> <input type="submit" name="sendForm" id="sendForm" value="{$lang.common.send}"/></td>
		</tr>
	</table>
</form>
{/if}

</body>
</html>